package cn.edu.nju.ws.sview.util;

import java.util.ArrayList;

import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class PropertyHandler  extends DefaultHandler{
    private String currentValue = null;
    private ArrayList<String> uris = new ArrayList<String>();
    
    public ArrayList<String> getURIs(){
    	return this.uris;
    }
    
	@Override
	public void characters(char[] ch, int start, int length)
			throws SAXException {
		// TODO Auto-generated method stub
		currentValue = new String(ch,start,length);
		super.characters(ch, start, length);
	}

	@Override
	public void endElement(String arg0, String arg1, String arg2)
			throws SAXException {
		// TODO Auto-generated method stub
		if(arg2.equalsIgnoreCase("uri")){
			this.uris.add(currentValue) ;
		}
		super.endElement(arg0, arg1, arg2);
	}


}
